home *** CD-ROM | disk | FTP | other *** search
/ Gigarom 1 / Gigarom Macintosh Archives (Quantum Leap)(CDRM1080320)(1993).iso / FILES / HYP / T-Z / XrefTextPack.cpt / XrefText_M / background_2583.txt < prev    next >
Text File  |  1989-02-26  |  8KB  |  301 lines

  1. -- background: 2583 from stack: in
  2. -- bmap block id: 5695
  3. -- flags: 0000
  4. -- background id: 0
  5. -- name: 
  6. ----- HyperTalk script -----
  7. on opencard
  8.   -- set lockText of field body to true
  9.   -- hide bkgnd button "Lock"
  10.   -- show bkgnd button "Edit"
  11. end opencard
  12.  
  13. on closecard
  14.   -- set lockText of field body to true
  15.   -- hide bkgnd button "Lock"
  16.   -- show bkgnd button "Edit"
  17.   hide field inlinks
  18.   hide field inlinkstitle
  19.   hide bkgnd button Hide
  20. end closecard
  21.  
  22.  
  23. -- part 1 (field)
  24. -- low flags: 00
  25. -- high flags: 2007
  26. -- rect: left=12 top=54 right=304 bottom=499
  27. -- title width / last selected line: 0
  28. -- icon id / first selected line: 0 / 0
  29. -- text alignment: 0
  30. -- font id: 2
  31. -- text size: 9
  32. -- style flags: 0
  33. -- line height: 12
  34. -- part name: body
  35. ----- HyperTalk script -----
  36. on mouseUp
  37.   -- handles goto for command-click
  38.   -- note that stack offsets message window
  39.   if selection is empty then
  40.     repeat two times
  41.       click at the clickLoc
  42.     end repeat
  43.     put the selection into holder
  44.     push card
  45.     visual effect wipe right to black
  46.     visual effect wipe left
  47.     find holder in field keywords
  48.     if the result is not empty then
  49.       answer "No match for keyword " "e& holder"e
  50.       pop card
  51.     end if
  52.     hide msg
  53.   end if
  54.   click at 0,0 --disable selection
  55. end mouseUp
  56.  
  57. On MouseWithin -- UNSOM technique by Guy Kuo, December 13, 1987
  58.   -- handles option-click to create new reference
  59.   if the OptionKey is down then
  60.     if the locktext of the target is true then
  61.       put true into DidUnlock
  62.       set locktext of target to false
  63.     else
  64.       put false into DidUnlock
  65.     end if
  66.     set the cursor to 2
  67.     repeat while (the OptionKey is down) and (item 1 of the rect of target <= item 1 of the mouseLoc) and (item 1 of the mouseLoc <= item 3 of the rect of target) and (item 2 of the rect of target <= item 2 of the mouseLoc) and (item 2 of the mouseLoc <= item 4 of the rect of target)
  68.       if the Mouse is down then
  69.         click at the MouseLoc
  70.         click at the ClickLoc
  71.         if the selection <> empty then
  72.           -- this is XrefText code
  73.           put the selection into holder
  74.           type holder & "*"
  75.           push card
  76.           find holder in field keywords
  77.           if the result is not empty then
  78.             doMenu New Card
  79.             put holder into field keywords
  80.             set the name of this card to holder
  81.             get the number of lines in card field finder of card theIndex
  82.             put holder into line it+1 of card field finder of card theIndex
  83.           else
  84.             put the length of holder into hl
  85.             put the length of word 1 of field keywords into kl
  86.             if hl<>kl then
  87.               answer "Close match but not exact!" with "Good Enough" or "New Card"
  88.               if it contains "New" then
  89.                 set lockscreen to true
  90.                 go prev
  91.                 doMenu New Card
  92.                 put holder into field keywords
  93.                 set the name of this card to holder
  94.                 get the number of lines in card field finder of card theIndex
  95.                 put holder into line it+1 of card field finder of card theIndex
  96.                 set lockscreen to false
  97.               end if
  98.             end if
  99.           end if
  100.         end if
  101.         if field body is empty then
  102.           type tab
  103.         else
  104.           click at -1,-1
  105.         end if
  106.       end if
  107.     end repeat
  108.     if DidUnlock then
  109.       set the locktext of the target to true
  110.     end if
  111.   end if
  112. end MouseWithin
  113.  
  114.  
  115.  
  116. -- part 2 (field)
  117. -- low flags: 01
  118. -- high flags: 2004
  119. -- rect: left=36 top=33 right=58 bottom=269
  120. -- title width / last selected line: 0
  121. -- icon id / first selected line: 0 / 0
  122. -- text alignment: 0
  123. -- font id: 2
  124. -- text size: 12
  125. -- style flags: 256
  126. -- line height: 16
  127. -- part name: keywords
  128. ----- HyperTalk script -----
  129. on mouseUp
  130.   set cursor to 4
  131.   put field keywords into holder
  132.   put the number of this card into num
  133.   put empty into field inlinks
  134.   put "One moment, Please." into line 2 of field inlinks
  135.   show field inlinkstitle
  136.   show field inlinks
  137.   show bkgnd button "Hide"
  138.   put "What links to " & holder &"?" into field inlinkstitle
  139.   put the number of cards into counter
  140.   set lockscreen to true
  141.   put empty into field inlinks
  142.   repeat counter
  143.     go next
  144.     if field body contains holder then
  145.       put return after last line of field inlinks of card num
  146.       put field keywords after last line of field inlinks of card num
  147.     end if
  148.   end repeat
  149.   play harpsichord
  150.   flash 1
  151.   show field inlinkstitle
  152.   show field inlinks
  153.   show bkgnd button "Hide"
  154.   set lockscreen to false
  155.   click at 0,0 --disable selection
  156.   set lockText of the target to true
  157. end mouseUp
  158.  
  159.  
  160.  
  161. -- part 12 (button)
  162. -- low flags: 80
  163. -- high flags: 8004
  164. -- rect: left=355 top=72 right=98 bottom=384
  165. -- title width / last selected line: 0
  166. -- icon id / first selected line: 0 / 0
  167. -- text alignment: 1
  168. -- font id: 0
  169. -- text size: 12
  170. -- style flags: 0
  171. -- line height: 16
  172. -- part name: OK
  173. ----- HyperTalk script -----
  174. on mouseUp
  175.   hide bkgnd button OK
  176.   show field body
  177. end mouseUp
  178.  
  179.  
  180.  
  181. -- part 40 (button)
  182. -- low flags: 00
  183. -- high flags: 0000
  184. -- rect: left=412 top=316 right=341 bottom=495
  185. -- title width / last selected line: 0
  186. -- icon id / first selected line: 0 / 0
  187. -- text alignment: 1
  188. -- font id: 0
  189. -- text size: 12
  190. -- style flags: 0
  191. -- line height: 16
  192. -- part name: DeleteCard
  193. ----- HyperTalk script -----
  194. on mouseUp
  195.   if the number of this card >1 then
  196.     answer "OK to delete this card?" with "OK" or "Cancel"
  197.     if it = "OK" then
  198.       doMenu Delete Card
  199.       go card theIndex
  200.       click at the loc of button "Re-Index"
  201.     end if
  202.   else
  203.     play boing
  204.     answer "Uh-uh. You don't want to delete this card."
  205.   end if
  206. end mouseUp
  207.  
  208.  
  209.  
  210. -- part 41 (field)
  211. -- low flags: 81
  212. -- high flags: 2002
  213. -- rect: left=258 top=32 right=52 bottom=426
  214. -- title width / last selected line: 0
  215. -- icon id / first selected line: 0 / 0
  216. -- text alignment: 1
  217. -- font id: 3
  218. -- text size: 9
  219. -- style flags: 0
  220. -- line height: 12
  221. -- part name: inlinkstitle
  222.  
  223.  
  224. -- part 42 (field)
  225. -- low flags: 81
  226. -- high flags: 2007
  227. -- rect: left=258 top=51 right=114 bottom=426
  228. -- title width / last selected line: 0
  229. -- icon id / first selected line: 0 / 0
  230. -- text alignment: 0
  231. -- font id: 2
  232. -- text size: 9
  233. -- style flags: 0
  234. -- line height: 12
  235. -- part name: inlinks
  236. ----- HyperTalk script -----
  237. on mouseUp
  238.   if the selection is empty then
  239.     set lockText of the target to false
  240.     put item 1 of the rect of field inlinks into leftend
  241.     put item 3 of the rect of field inlinks into rightend
  242.     put item 2 of the clickloc into vert
  243.     click at leftend+2,vert
  244.     click at rightend-25,vert with shiftkey
  245.     put the selection into holder
  246.     push card
  247.     visual effect wipe right to black
  248.     visual effect wipe left
  249.     find holder in field keywords -- This line is the link
  250.     if the result is not empty then
  251.       answer "No match for keyword " "e& holder"e
  252.       pop card
  253.     end if
  254.     click at 0,0 --disable selection
  255.     set lockText of the target to true
  256.   end if
  257. end mouseUp
  258.  
  259.  
  260.  
  261. -- part 43 (button)
  262. -- low flags: 80
  263. -- high flags: 8003
  264. -- rect: left=413 top=37 right=58 bottom=452
  265. -- title width / last selected line: 0
  266. -- icon id / first selected line: 0 / 0
  267. -- text alignment: 1
  268. -- font id: 0
  269. -- text size: 12
  270. -- style flags: 0
  271. -- line height: 16
  272. -- part name: Hide
  273. ----- HyperTalk script -----
  274. on mouseUp
  275.   hide field inlinks
  276.   hide field inlinkstitle
  277.   hide bkgnd button Hide
  278. end mouseUp
  279.  
  280.  
  281.  
  282. -- part 44 (button)
  283. -- low flags: 00
  284. -- high flags: 0000
  285. -- rect: left=390 top=315 right=342 bottom=409
  286. -- title width / last selected line: 0
  287. -- icon id / first selected line: 0 / 0
  288. -- text alignment: 1
  289. -- font id: 0
  290. -- text size: 12
  291. -- style flags: 0
  292. -- line height: 16
  293. -- part name: Home
  294. ----- HyperTalk script -----
  295. on mouseUp
  296.   visual effect iris close to black
  297.   visual effect iris open to white
  298.   go home
  299. end mouseUp
  300.  
  301.